module lang.d.sts.expressions.dfunctioncall;

import lang.d.sts.expressions.dexpression;
import lang.d.sts.expressions.dparenizedexpression;
import lang.d.visitors.dvisitor;

class DFunctionCall: DExpression {
    private DExpression myPrimaryExpression;
    private DParenizedExpression myArguments;

    public this(DExpression primaryExpression) {
        myPrimaryExpression = primaryExpression;
        primaryExpression.setParent(this);
    }

    public void setArguments(DParenizedExpression arguments) {
        myArguments = arguments;
        arguments.setParent(this);
    }

    public DExpression getPrimaryExpression()
    in {
        assert(myPrimaryExpression !is null);
    }
    body {
        return myPrimaryExpression;
    }

    public DParenizedExpression getArguments()
    in {
        assert(myArguments !is null);
    }
    body {
        return myArguments;
    }

    override public void accept(DVisitor visitor) {
        visitor.visitFunctionCall(this);
    }
}
